package org.example.framework.protocol.http;

import org.example.framework.Invocation;
import org.example.framework.Invoker;
import org.example.framework.URL;

public class HttpInvoker implements Invoker {
    private URL url;

    public HttpInvoker(URL url) { this.url = url; }

    @Override
    public String invoke(Invocation invocation) {
        HttpClient httpClient = new HttpClient();
        return httpClient.send(url.getHostname(), url.getPort(), invocation);
    }
}
